import {message} from 'antd';
import {formatMessage} from './intl';
export const validateAdd = details => {
    if(!details.length) {
        message.warning(formatMessage({
            id: 'validate.details',
            defaultMessage: '请选择导入清单'
        }));
        return false;
    }
    if(details.length > 0)
        for(let i = 0; i < details.length; i++) {
            const item = details[i];
            if(item.dealerId === '' || item.partId === '') {
                message.warning(formatMessage({
                    id: 'validator.dealerPart',
                    defaultMessage: '总代与备件号不能为空'
                }));
                return false;
            }
        }
    return true;
};
